<?php
/**
 * 用户管理
 * Created by gii.
 * User: Gii
 * Date: 2023/02/23
 * Time: 16:10
 */

namespace app\admin\logic\system;

use app\admin\model\model\system\User;

class UserLogic
{
    public static function getListWithCount($where=[], $field='*', $page=1, $limit=10, $order='id desc') {
        $where = User::getSelfWhereCommon($where);
        return User::getListWithCountCommon($where, $field, $page, $limit, $order);
    }

    public static function getAll() {
        return User::getAllCommon();
    }

    public static function del($id) {
        return User::delByPkCommon($id);
    }

    public static function update($data) {
        return User::updateCommon($data);
    }

    public static function add($data) {
        return User::addCommon($data);
    }

    public static function getOne($id) {
        return User::getLineByPkCommon($id);
    }

    public static function status($id, $status) {
        return User::status($id, $status);
    }
}
